using System;

namespace PetShop.Domain.Model
{
	
	
	
	[Serializable]
	public class ItemEntity{


        private string _Id;
        private int _InventoryQty;
        private decimal _ListPrice;
        private string _Description;
        private ProductEntity _Product;


     
           

        public virtual string Id
        {
            get
            {
                return _Id;
            }
            set
            {
                _Id = value;
            }
        }

        public virtual int InventoryQty
        {
            get
            {
                return _InventoryQty;
            }
            set
            {
                _InventoryQty = value;
            }
        }

        public virtual decimal ListPrice
        {
            get
            {
                return _ListPrice;
            }
            set
            {
                _ListPrice = value;
            }
        }

        public virtual string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                _Description = value;
            }
        }

        public virtual ProductEntity Product
        {
            get
            {
                return _Product;
            }
            set
            {
                _Product = value;
            }
        }


        public bool IsThereEnoughInStock(int requestedCartItemQuantity)
        {

            int unitsInStock = this._InventoryQty;
            int unitInStockprevision = unitsInStock - requestedCartItemQuantity;
            bool enoughInStock;
            if (unitInStockprevision >= 0)
            {
                enoughInStock = true;
            }
            else
            {
                enoughInStock = false;
            }
            return enoughInStock;
        }

     
	}
}
